﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;

namespace Utility
{
    public static class TextViewUtil
    {
        public static string GetFileName(ITextView textView)
        {
            string result = null;
            ITextDocument textDoc;
            bool r = textView.TextBuffer.Properties.TryGetProperty<ITextDocument>(typeof(ITextDocument), out textDoc);
            if (r)
                result = textDoc.FilePath;
            return result;
        }


    }
}
